Using Euclids Extended Algorithm:
Calculate x and y in Bézout's Identity
using (7,24)
For 2 numbers a and b and divisor d:
ax + by = d
a math | a | b math | b | d math | d | k math | k |
---|---|---|---|---|---|---|---|
Set to 1 | 1 | Set to 0 | 0 | 7 | |||
Set to 0 | 0 | Set to 1 | 1 | 24 | Quotient of 7/24 | 0 | |
1 - (0 x 0) | 1 | 0 - (0 x 1) | 0 | Remainder of 7/24 | 7 | Quotient of 24/7 | 3 |
0 - (3 x 1) | -3 | 1 - (3 x 0) | 1 | Remainder of 24/7 | 3 | Quotient of 7/3 | 2 |
1 - (2 x -3) | 7 | 0 - (2 x 1) | -2 | Remainder of 7/3 | 1 | Quotient of 3/1 | 3 |
-3 - (3 x 7) | -24 | 1 - (3 x -2) | 7 | Remainder of 3/1 | 0 | Quotient of 1/0 | 0 |
a = 7 and b = -2
ax + by = gcd(a,b)
7x + 24y = gcd(7